Skip to content

Register suggest_query_params in core - #223

Merged
wpak-ai merged 4 commits into
cppalliance:mainfrom
timon0305:feat/register-suggest-query-params-core-221
Jul 15, 2026
Merged

Register suggest_query_params in core#223
wpak-ai merged 4 commits into
cppalliance:mainfrom
timon0305:feat/register-suggest-query-params-core-221

Conversation

@timon0305

@timon0305 timon0305 commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Closes #221.

suggest_query_params was registered only in the Alliance overlay, so a core-initialized server could not expose it without pulling in Alliance. This moves the tool into core and registers it there.

What changed

  • Moved suggest-query-params-tool.ts (and its two co-located tests) from src/alliance/tools/ to src/core/server/tools/. The tool only imported from core/server, so the move is clean and removes a core test that was reaching across into alliance/.
  • Registered it in setupCoreServerOnContext (after guided_query).
  • Removed the now-duplicate registration from alliance/setup.ts — Alliance still gets the tool via the core setup it calls, so no double-registration.

Scope (deliberately narrow)

  • No change to the disableSuggestFlow default — core stays gate-off, guided_query first.
  • No change to CORE_SERVER_INSTRUCTIONS.
  • Alliance behaviour unchanged (gate on, tool present).

The core/Alliance gate defaults and ceremony settled in #159/#160 are not revisited here.

Tests

Added a core setup registers suggest_query_params assertion (mirrors the existing guided_query one) and updated the RC-readiness core tool list. Full CI gate passes locally (typecheck, lint, format, build, benchmark smoke, 368 tests, coverage above thresholds).

Summary by CodeRabbit

  • New Features
    • Added the suggest_query_params tool to the core server tool surface.
    • Updated the Alliance server setup so its tool surface is composed from core tools plus built-in URL generators.
  • Bug Fixes
    • Clarified and aligned suggest-flow gate behavior for when the gate is enabled vs disabled.
  • Tests
    • Expanded coverage for cross-entry-point registration, core tool listing, and successful in-memory suggest_query_params invocation.
  • Documentation
    • Updated docs/TOOLS.md and core tool-count/gating rules to reflect the suggest_query_params tool and gate behavior.

Move the suggest_query_params tool from the Alliance overlay into core
(src/core/server/tools/) and register it in setupCoreServerOnContext, so a
core-initialized server can expose it. The tool only imported from core/server,
so this is a clean move; Alliance still gets it via the core setup it calls, and
its now-duplicate registration is removed.

Deliberately narrow per the issue: no change to the disableSuggestFlow default
(core stays gate-off, guided_query first) or to CORE_SERVER_INSTRUCTIONS, and
Alliance behaviour is unchanged. Adds a core-registration test and updates the
RC-readiness core tool list.
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3ede0bc9-ba47-44a0-9128-77db91b59146

📥 Commits

Reviewing files that changed from the base of the PR and between 2ca255e and ef28bdd.

📒 Files selected for processing (1)
  • src/core/server/tools/suggest-query-params-tool.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/core/server/tools/suggest-query-params-tool.ts

📝 Walkthrough

Walkthrough

Core setup now registers suggest_query_params; Alliance removes duplicate registration in favor of built-in URL generators, with tests and documentation updated for the expanded core tool surface and suggest-flow behavior.

Changes

Core suggest query registration

Layer / File(s) Summary
Core tool registration and coverage
src/core/setup.ts, src/constants.ts, src/__tests__/cross-entry-point.test.ts, src/__tests__/mcp-rc-readiness.test.ts
Core setup registers suggest_query_params; tests verify registration, listing, and successful invocation on a core server.
Alliance registration wiring and documentation
src/alliance/setup.ts, docs/TOOLS.md
Alliance no longer registers suggest_query_params directly and instead registers built-in URL generators; documentation describes the updated surfaces and gate behavior.
Local tool module alignment
src/core/server/tools/*suggest-query-params*, src/core/server/tools/guided-query-tool.context.test.ts
Tool implementation and related tests use updated local module paths, with the tool description clarifying gate requirements.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CoreSetup
  participant CoreToolSurface
  participant SuggestTool
  participant MCPServer
  CoreSetup->>CoreToolSurface: register core tools
  CoreToolSurface->>SuggestTool: register suggest_query_params
  SuggestTool->>MCPServer: expose callable tool
  MCPServer-->>CoreSetup: return successful suggestion response
Loading

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: wpak-ai, auramindnest

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: registering suggest_query_params in core.
Linked Issues check ✅ Passed The changes register suggest_query_params in core, add callable coverage, and preserve the described gate defaults and Alliance behavior.
Out of Scope Changes check ✅ Passed No clear out-of-scope code changes are present; the docs, comments, and import rewrites support the core registration move.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@9ce9e7b). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #223   +/-   ##
=======================================
  Coverage        ?   85.07%           
=======================================
  Files           ?       46           
  Lines           ?     2399           
  Branches        ?      826           
=======================================
  Hits            ?     2041           
  Misses          ?      357           
  Partials        ?        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/__tests__/cross-entry-point.test.ts`:
- Around line 124-140: Extend the test around setupCoreServer and
registerSuggestQueryParamsTool to invoke the registered suggest_query_params
tool through the initialized server context, not just spy on registration.
Assert the tool is exposed and callable, then validate its returned response
while preserving the existing registration assertion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 24fd60f0-45a7-446a-a967-1ab49a9f695b

📥 Commits

Reviewing files that changed from the base of the PR and between 9ce9e7b and b7dc1fa.

📒 Files selected for processing (8)
  • src/__tests__/cross-entry-point.test.ts
  • src/__tests__/mcp-rc-readiness.test.ts
  • src/alliance/setup.ts
  • src/core/server/tools/guided-query-tool.context.test.ts
  • src/core/server/tools/suggest-query-params-tool.context.test.ts
  • src/core/server/tools/suggest-query-params-tool.test.ts
  • src/core/server/tools/suggest-query-params-tool.ts
  • src/core/setup.ts
💤 Files with no reviewable changes (1)
  • src/alliance/setup.ts

Comment thread src/__tests__/cross-entry-point.test.ts
…liance#221 review)

The cross-entry-point test proves core setup invokes the registrar; add a
callTool round-trip in the RC-readiness harness so a core-initialized server
actually exposes and executes suggest_query_params (asserts status success +
namespace_found). A broken registration can no longer pass by only being listed.
Comment thread src/core/setup.ts
…view)

suggest_query_params is now registered in core, so update the docs that still
called it Alliance-specific: the setupCoreServer docblock (nine core tools, ten
with multi-source list_sources; tool registered but the suggest-flow gate stays
off by default for core), the CORE_SERVER_INSTRUCTIONS docstring and the
setupAllianceServer docblock, and the Core-vs-Alliance table + gate paragraph in
TOOLS.md. Alliance's Boost/Slack URL generators are clarified as generate_urls
registry entries, not a separate MCP tool. PACKAGE_SPLIT_EVAL.md left as a
point-in-time eval.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/TOOLS.md`:
- Around line 30-37: The core-facing metadata for suggest_query_params still
describes the call as mandatory despite the default disabled gate. Update the
registration description in suggest-query-params-tool.ts so it states the step
is mandatory only when the suggest-flow gate is enabled, while describing it as
optional when the gate is disabled; preserve the existing Alliance-enabled
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 40b1d3fd-30ab-4157-8204-63bbeede926a

📥 Commits

Reviewing files that changed from the base of the PR and between b7dc1fa and 2ca255e.

📒 Files selected for processing (5)
  • docs/TOOLS.md
  • src/__tests__/mcp-rc-readiness.test.ts
  • src/alliance/setup.ts
  • src/constants.ts
  • src/core/setup.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/core/setup.ts
  • src/alliance/setup.ts

Comment thread docs/TOOLS.md
…tate

The tool description said the call is mandatory before query/count tools
unconditionally, but core registers the tool with the suggest-flow gate
off by default. Say it's required only when the gate is enabled (Alliance
default) and optional otherwise, matching the gate paragraph in TOOLS.md.
@timon0305
timon0305 requested a review from jonathanMLDev July 15, 2026 19:14
@wpak-ai
wpak-ai merged commit bd94c14 into cppalliance:main Jul 15, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Register suggest_query_params in core

3 participants